package com.foton.lotterydomain.strategy.service.draw;

import com.foton.lotterydomain.strategy.model.aggregates.StrategyRich;
import com.foton.lotterydomain.strategy.model.vo.AwardBriefVO;
import com.foton.lotterydomain.strategy.repository.IStrategyRepository;

import javax.annotation.Resource;

/**
 * @Author RenPu
 * @Date 2023/11/24 15:04
 * @Version 1.0
 * @Description: 抽象方法，将业务实现得仓储操作，也就是操作数据库得动作进行抽离
 **/
public class DrawStrategySupport extends DrawConfig {

    @Resource
    protected IStrategyRepository strategyRepository;

    /**
     * 根据strategyId（策略编码）获取抽奖策略
     *
     * @param strategyId
     * @return
     */
    public StrategyRich queryStrategyRich(Long strategyId) {
        return strategyRepository.queryStrategyRich(strategyId);
    }


    /**
     * 根据奖品id获取奖品信息
     *
     * @param awardId
     * @return
     */
    public AwardBriefVO queryAwardInfo(String awardId) {
        return strategyRepository.queryAwardInfo(awardId);
    }


}
